/*
 * @Author: wuqingchun
 * @Date: 2024-05-23 14:29:50
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-07-10 20:02:09
 */
#ifndef __EVENT_H__
#define __EVENT_H__

#include <unistd.h>
#include <sys/epoll.h>
#include <sys/types.h>
#include <sys/socket.h>

class IEventBase
{
public:
    virtual int HandleIn() = 0;
    virtual int HandleOut() = 0;
    virtual void HandleError() = 0;
    virtual int GetEventFd() = 0;
};

class NetEvent : public IEventBase
{
public:
    virtual int HandleIn() override final
    {

    }

    virtual int HandleOut() override final
    {

    }

    virtual void HandleError() override final
    {
        if (m_iSockFd != -1)
        {
            close(m_iSockFd);

            m_iSockFd = -1;
        }
    }

    int GetEventFd()
    {
        return m_iSockFd;
    }

private:
    int m_iSockFd = -1;
};

#endif //__EVENT_H__